# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AuthorizedBuyersMarketplace.V1.Model.SendRfpRequest do
  @moduledoc """
  Request to send an RFP. All fields in this request are proposed to publisher and subject to changes by publisher during later negotiation.

  ## Attributes

  *   `buyerContacts` (*type:* `list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Contact.t)`, *default:* `nil`) - Contact information for the buyer.
  *   `client` (*type:* `String.t`, *default:* `nil`) - If the current buyer is sending the RFP on behalf of its client, use this field to specify the name of the client in the format: `buyers/{accountId}/clients/{clientAccountid}`.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. The display name of the proposal being created by this RFP.
  *   `estimatedGrossSpend` (*type:* `GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Money.t`, *default:* `nil`) - Specified by buyers in request for proposal (RFP) to notify publisher the total estimated spend for the proposal. Publishers will receive this information and send back proposed deals accordingly.
  *   `flightEndTime` (*type:* `DateTime.t`, *default:* `nil`) - Required. Proposed flight end time of the RFP. A timestamp in RFC3339 UTC "Zulu" format. Note that the specified value will be truncated to a granularity of one second.
  *   `flightStartTime` (*type:* `DateTime.t`, *default:* `nil`) - Required. Proposed flight start time of the RFP. A timestamp in RFC3339 UTC "Zulu" format. Note that the specified value will be truncated to a granularity of one second.
  *   `geoTargeting` (*type:* `GoogleApi.AuthorizedBuyersMarketplace.V1.Model.CriteriaTargeting.t`, *default:* `nil`) - Geo criteria IDs to be targeted. Refer to Geo tables.
  *   `inventorySizeTargeting` (*type:* `GoogleApi.AuthorizedBuyersMarketplace.V1.Model.InventorySizeTargeting.t`, *default:* `nil`) - Inventory sizes to be targeted.
  *   `note` (*type:* `String.t`, *default:* `nil`) - A message that is sent to the publisher. Maximum length is 1024 characters.
  *   `preferredDealTerms` (*type:* `GoogleApi.AuthorizedBuyersMarketplace.V1.Model.PreferredDealTerms.t`, *default:* `nil`) - The terms for preferred deals.
  *   `programmaticGuaranteedTerms` (*type:* `GoogleApi.AuthorizedBuyersMarketplace.V1.Model.ProgrammaticGuaranteedTerms.t`, *default:* `nil`) - The terms for programmatic guaranteed deals.
  *   `publisherProfile` (*type:* `String.t`, *default:* `nil`) - Required. The profile of the publisher who will receive this RFP in the format: `buyers/{accountId}/publisherProfiles/{publisherProfileId}`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :buyerContacts =>
            list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Contact.t()) | nil,
          :client => String.t() | nil,
          :displayName => String.t() | nil,
          :estimatedGrossSpend => GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Money.t() | nil,
          :flightEndTime => DateTime.t() | nil,
          :flightStartTime => DateTime.t() | nil,
          :geoTargeting =>
            GoogleApi.AuthorizedBuyersMarketplace.V1.Model.CriteriaTargeting.t() | nil,
          :inventorySizeTargeting =>
            GoogleApi.AuthorizedBuyersMarketplace.V1.Model.InventorySizeTargeting.t() | nil,
          :note => String.t() | nil,
          :preferredDealTerms =>
            GoogleApi.AuthorizedBuyersMarketplace.V1.Model.PreferredDealTerms.t() | nil,
          :programmaticGuaranteedTerms =>
            GoogleApi.AuthorizedBuyersMarketplace.V1.Model.ProgrammaticGuaranteedTerms.t() | nil,
          :publisherProfile => String.t() | nil
        }

  field(:buyerContacts, as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Contact, type: :list)
  field(:client)
  field(:displayName)
  field(:estimatedGrossSpend, as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Money)
  field(:flightEndTime, as: DateTime)
  field(:flightStartTime, as: DateTime)
  field(:geoTargeting, as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.CriteriaTargeting)

  field(:inventorySizeTargeting,
    as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.InventorySizeTargeting
  )

  field(:note)

  field(:preferredDealTerms, as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.PreferredDealTerms)

  field(:programmaticGuaranteedTerms,
    as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.ProgrammaticGuaranteedTerms
  )

  field(:publisherProfile)
end

defimpl Poison.Decoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.SendRfpRequest do
  def decode(value, options) do
    GoogleApi.AuthorizedBuyersMarketplace.V1.Model.SendRfpRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.SendRfpRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
